(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/house/bill/detail" ], {
    2096: function(t, n, o) {
        (function(a) {
            function e(e, t) {
                var n, o = Object.keys(e);
                return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(e), t && (n = n.filter(function(t) {
                    return Object.getOwnPropertyDescriptor(e, t).enumerable;
                })), o.push.apply(o, n)), o;
            }
            Object.defineProperty(n, "__esModule", {
                value: !0
            });
            var t = {
                components: {},
                data: function() {
                    return {
                        house: {},
                        t_user: {},
                        template: {},
                        id: 0,
                        bill: {},
                        contract: {},
                        way_list: [ {
                            name: "线上支付",
                            value: 1
                        }, {
                            name: "线下支付",
                            value: 2
                        } ],
                        form: {
                            pay_type: 1,
                            pay_imgs: [],
                            pay_remarks: ""
                        }
                    };
                },
                computed: function(o) {
                    for (var t = 1; t < arguments.length; t++) {
                        var i = null != arguments[t] ? arguments[t] : {};
                        t % 2 ? e(Object(i), !0).forEach(function(t) {
                            var e, n;
                            e = o, t = i[n = t], n in e ? Object.defineProperty(e, n, {
                                value: t,
                                enumerable: !0,
                                configurable: !0,
                                writable: !0
                            }) : e[n] = t;
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(i)) : e(Object(i)).forEach(function(t) {
                            Object.defineProperty(o, t, Object.getOwnPropertyDescriptor(i, t));
                        });
                    }
                    return o;
                }({}, (n.default = void 0, o("26cb").mapState)({
                    staff: function(t) {
                        return t.user.staff;
                    }
                })),
                onLoad: function() {
                    var t = this.$Route.query;
                    this.id = t.id, this.init();
                },
                onReady: function() {},
                beforeRouteLeave: function(t, e, n) {
                    console.info("leave"), n();
                },
                methods: {
                    init: function() {
                        var n = this;
                        this.$api("my.bill_detail", {
                            id: n.id
                        }).then(function(t) {
                            var e;
                            0 == t.errno && (e = t.data.bill, n.bill = e, n.contract = t.data.contract);
                        });
                    },
                    select_way: function(t) {
                        this.form.pay_type = t.value;
                    },
                    startDayChange: function(t) {
                        this.form.start_time = t.detail.value;
                    },
                    endDayChange: function(t) {
                        this.form.end_time = t.detail.value;
                    },
                    navToHouse: function() {
                        this.$Router.push({
                            path: "/pages/store/select-house",
                            query: {}
                        });
                    },
                    choose_house: function(t) {
                        this.form.house_id = t, this.init();
                    },
                    onChooseImg: function(e, t) {
                        var n = this, t = t - e.length;
                        n.$tools.chooseImage(t).then(function(t) {
                            t.forEach(function(t) {
                                n.$tools.uploadFile("file.upload", t).then(function(t) {
                                    e.push(t.url);
                                });
                            });
                        });
                    },
                    delImg: function(e, n) {
                        a.showModal({
                            title: "删除照片",
                            content: "确定要删除这张照片么？",
                            cancelText: "取消",
                            confirmText: "删除",
                            success: function(t) {
                                t.confirm && e.splice(n, 1);
                            }
                        });
                    },
                    formSubmit: function(t) {
                        var e, n, o = this, i = this.form;
                        2 == i.pay_type ? 0 != i.pay_imgs.length ? (a.showLoading({
                            mask: !0,
                            title: "正在提交"
                        }), o.$api("my.pay_bill", {
                            id: o.id,
                            pay_type: i.pay_type,
                            pay_imgs: i.pay_imgs.join(","),
                            pay_remarks: i.pay_remarks
                        }, "post").then(function(t) {
                            a.hideLoading(), 0 == t.errno ? (o.$tools.toast("提交成功"), setTimeout(function() {
                                o.$Router.replace({
                                    path: "/pages/house/bill/list"
                                });
                            }, 500)) : o.$tools.toast("异常");
                        })) : o.$tools.toast("请上传支付凭证") : (n = (e = this).bill.money) <= 0 || a.showModal({
                            title: "确认",
                            content: "支付费用：" + n + "元",
                            confirmText: "付费",
                            success: function(t) {
                                if (t.confirm) a.showLoading({
                                    title: "加载中"
                                }), e.$api("my.pay_bill", {
                                    id: e.id,
                                    pay_type: i.pay_type,
                                    pay_remarks: i.pay_remarks
                                }, "post").then(function(t) {
                                    a.hideLoading(), 0 === t.errno ? 0 == t.data.code ? (e.$tools.toast("付款成功"), e.init()) : 1 == t.data.code && a.showModal({
                                        title: "提示",
                                        content: t.data.msg,
                                        confirmText: "充值",
                                        success: function(t) {
                                            if (t.confirm) e.$Router.push({
                                                path: "/pages/user/wallet/index",
                                                query: {}
                                            }); else if (t.cancel) return;
                                        }
                                    }) : e.$tools.toast(t.msg);
                                }); else if (t.cancel) return;
                            }
                        });
                    }
                }
            };
            n.default = t;
        }).call(this, o("543d").default);
    },
    "4bd3": function(t, e, n) {
        n.r(e);
        var o, i = n("2096"), a = n.n(i);
        for (o in i) "default" !== o && function(t) {
            n.d(e, t, function() {
                return i[t];
            });
        }(o);
        e.default = a.a;
    },
    "74ab": function(t, e, o) {
        (function(t) {
            o("767a"), n(o("66fd"));
            var e = n(o("ce35"));
            function n(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = o, t(e.default);
        }).call(this, o("543d").createPage);
    },
    a3f5: function(t, e, n) {
        var o = n("baf3");
        n.n(o).a;
    },
    baf3: function(t, e, n) {},
    ce35: function(t, e, n) {
        n.r(e);
        var o, i = n("d41b"), a = n("4bd3");
        for (o in a) "default" !== o && function(t) {
            n.d(e, t, function() {
                return a[t];
            });
        }(o);
        n("a3f5");
        var r = n("f0c5"), i = Object(r.a)(a.default, i.b, i.c, !1, null, null, null, !1, i.a, void 0);
        e.default = i.exports;
    },
    d41b: function(t, e, n) {
        n.d(e, "b", function() {
            return o;
        }), n.d(e, "c", function() {
            return i;
        }), n.d(e, "a", function() {});
        var o = function() {
            this.$createElement;
            this._self._c;
        }, i = [];
    }
}, [ [ "74ab", "common/runtime", "common/vendor" ] ] ]);